Skip to content

[pull] main from MetaMask:main#737

Merged
pull[bot] merged 3 commits intoReality2byte:mainfrom
MetaMask:main
May 7, 2026
Merged

[pull] main from MetaMask:main#737
pull[bot] merged 3 commits intoReality2byte:mainfrom
MetaMask:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented May 7, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

weitingsun and others added 3 commits May 7, 2026 01:02
<!--
Please submit this PR as a draft initially.

Do not mark it as "Ready for review" until this PR meets the canonical
Definition of Ready For Review in `docs/readme/ready-for-review.md`.

In short: the template must be materially complete (not just section
titles
present), all status checks must be currently passing, and the only
expected
follow-up commits must be reviewer-driven.
-->

## **Description**
This PR introduces two shared `NativeStackNavigationOptions` presets in
`clearStackNavigatorOptions.ts`:

Perps already uses `createNativeStackNavigator`, but several screens
repeated the same option blobs (`presentation: 'transparentModal'`,
transparent `contentStyle`, `animation: 'none'`, `headerShown: false`)
inline. That duplicated the JS-stack `clearStackNavigatorOptions` idea
without a typed, reusable native-stack equivalent.



## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry:null

## **Related issues**

Fixes:

## **Manual testing steps**

```gherkin
Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]
```

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

<!--
Every checklist item must be consciously assessed before marking this PR
as
"Ready for review". A checked box means you deliberately considered that
responsibility, not that you literally performed every action listed.

Unchecked boxes are ambiguous: they are not an implicit "N/A" and they
are not
a silent "skip". See `docs/readme/ready-for-review.md` for the full
checklist
semantics.
-->

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [ ] I've included tests if applicable
- [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

#### Performance checks (if applicable)

- [ ] I've tested on Android
  - Ideally on a mid-range device; emulator is acceptable
- [ ] I've tested with a power user scenario
- Use these [power-user
SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93)
to import wallets with many accounts and tokens
- [ ] I've instrumented key operations with Sentry traces for production
performance metrics
- See [`trace()`](/app/util/trace.ts) for usage and
[`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274)
for an example

For performance guidelines and tooling, see the [Performance
Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers).

## **Pre-merge reviewer checklist**

<!--
Reviewer checklist items follow the same semantics as the author
checklist: an
unchecked box is ambiguous, a checked box means the reviewer consciously
assessed that responsibility. See `docs/readme/ready-for-review.md`.
-->

- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Moderate risk because it changes React Navigation option presets for
native stacks, which can affect modal presentation, animations, and
header behavior across Perps flows.
> 
> **Overview**
> Standardizes Perps native-stack overlay behavior by replacing inline
`presentation: 'transparentModal'`/transparent styling with shared
presets (`transparentModalScreenOptions`,
`clearNativeStackNavigatorOptions`).
> 
> Adds native-stack equivalents of the existing clear JS-stack options
in `clearStackNavigatorOptions.ts`, and updates Perps screens (TP/SL,
close-position/bottom-sheet stacks, and pay-with modal) to use these
presets for consistent transparent modals without unwanted animations.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
3a0cec5. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!--
Please submit this PR as a draft initially.

Do not mark it as "Ready for review" until this PR meets the canonical
Definition of Ready For Review in `docs/readme/ready-for-review.md`.

In short: the template must be materially complete (not just section
titles
present), all status checks must be currently passing, and the only
expected
follow-up commits must be reviewer-driven.
-->

## **Description**
https://consensyssoftware.atlassian.net/browse/RWDS-1267
The Rewards crash likely came from an older persisted Rewards Redux
state that did not have newer array fields, especially campaigns. On
affected devices, selectCampaigns could return undefined.

It was account/device dependent because persisted state differs per
user/install.

Fix Applied: hardened both the restore path and selector path to
fallback to initial state (empty array or object instead of undefined)

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Fixes: https://consensyssoftware.atlassian.net/browse/RWDS-1267

## **Manual testing steps**

```gherkin
Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]
```

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

<!--
Every checklist item must be consciously assessed before marking this PR
as
"Ready for review". A checked box means you deliberately considered that
responsibility, not that you literally performed every action listed.

Unchecked boxes are ambiguous: they are not an implicit "N/A" and they
are not
a silent "skip". See `docs/readme/ready-for-review.md` for the full
checklist
semantics.
-->

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

#### Performance checks (if applicable)

- [x] I've tested on Android
  - Ideally on a mid-range device; emulator is acceptable
- [x] I've tested with a power user scenario
- Use these [power-user
SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93)
to import wallets with many accounts and tokens
- [x] I've instrumented key operations with Sentry traces for production
performance metrics
- See [`trace()`](/app/util/trace.ts) for usage and
[`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274)
for an example

For performance guidelines and tooling, see the [Performance
Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers).

## **Pre-merge reviewer checklist**

<!--
Reviewer checklist items follow the same semantics as the author
checklist: an
unchecked box is ambiguous, a checked box means the reviewer consciously
assessed that responsibility. See `docs/readme/ready-for-review.md`.
-->

- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk: changes are defensive fallbacks for missing/undefined
persisted state and selector inputs, with added tests; behavior should
only differ for legacy/partial states.
> 
> **Overview**
> Prevents Rewards tab crashes caused by older/partial persisted
Redux/controller state by **defaulting missing fields to safe empty
values**.
> 
> Selectors and rehydrate logic now coalesce `undefined` arrays/objects
(e.g., `campaigns`, season arrays, `benefits`, dismissed-toasts map,
controller `accounts`/`subscriptions`) to empty defaults, and
`RewardsController` default state was extracted into `defaultState.ts`
and reused. Test coverage was expanded to lock in these
upgrade/undefined-state behaviors.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
d7b351d. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
…29813)

## **Description**

Replaces the legacy `Bank` icon used by the Money tab in the bottom
navigation bar with the new Dollar glyph from the Figma spec (MUSD-773),
in both selected (filled) and unselected (outline) states.

- Adds two new SVG assets: `dollar.svg` (outlined circle + dollar sign)
and `dollar-filled.svg` (solid circle with dollar-sign cutout).
- Both SVGs use `currentColor` for stroke and fill so the Icon component
can tint them per theme — they pick up the correct active/inactive color
in both light and dark mode, matching the convention used by the other
tab bar icons (`Home`/`HomeFilled`,
`MetamaskFoxOutline`/`MetamaskFoxFilled`).
- The filled variant uses `fill-rule="evenodd"` so the dollar sign is a
transparent cutout through the colored circle, showing the tab-bar
background through it (avoids hardcoded light/dark color pairs).
- Wires the new icons in `TabBar.constants.ts` (inactive →
`IconName.Dollar`) and `TabBar.tsx` (`FILLED_ICONS` map →
`IconName.DollarFilled`).
- Adds `Dollar` and `DollarFilled` to the local `IconName` enum and
asset map by hand to avoid the side-effect rewrite that `yarn
generate-icons` would have done to the rest of the enum.

## **Changelog**

CHANGELOG entry: null

## **Related issues**

Fixes:
[MUSD-773](https://consensyssoftware.atlassian.net/browse/MUSD-773)

## **Manual testing steps**

```gherkin
Feature: Money tab uses the new Dollar icon in both states and themes

  Scenario: Money tab is unselected in light mode
    Given the app is in light mode
    And the user is not on the Money tab
    Then the Money tab icon is the outlined Dollar glyph
    And its stroke and dollar sign use the inactive icon tint

  Scenario: Money tab is unselected in dark mode
    Given the app is in dark mode
    And the user is not on the Money tab
    Then the Money tab icon is the outlined Dollar glyph
    And its stroke and dollar sign use the inactive icon tint

  Scenario: Money tab is selected in light mode
    Given the app is in light mode
    When the user taps the Money tab
    Then the Money tab icon switches to the filled Dollar glyph
    And the circle paints in the active icon tint
    And the dollar sign is transparent, showing the tab-bar background through it

  Scenario: Money tab is selected in dark mode
    Given the app is in dark mode
    When the user taps the Money tab
    Then the Money tab icon switches to the filled Dollar glyph
    And the circle paints in the active icon tint
    And the dollar sign is transparent, showing the tab-bar background through it
```

## **Screenshots/Recordings**

### **Before**

### **After**

<img width="1206" height="2622" alt="image"
src="https://github.com/user-attachments/assets/74c25f60-fd6e-4b98-8645-aa7a1b907c92"
/>


<img width="1206" height="2622" alt="image"
src="https://github.com/user-attachments/assets/2d54975e-87db-49ee-876a-266f60682deb"
/>


## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I've included tests if applicable
- [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

#### Performance checks (if applicable)

- [ ] I've tested on Android
- [ ] I've tested with a power user scenario
- [ ] I've instrumented key operations with Sentry traces for production
performance metrics

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

[MUSD-773]:
https://consensyssoftware.atlassian.net/browse/MUSD-773?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk UI-only change that swaps icon assets and enum entries; main
risk is any missed references to the removed/renamed `IconName` values
causing build-time errors.
> 
> **Overview**
> Updates the bottom navigation **Money** tab to use new
`Musd`/`MusdFilled` icon assets instead of the legacy bank glyph, wiring
them through the tab bar icon maps.
> 
> Extends the icon system with new `IconName` entries and SVG assets,
and updates Portfolio-related tab UI/tests to use `IconName.PieChart` in
place of the removed `IconName.Portfolio` (including
`HomepageDiscoveryTabs`).
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
ee491bb. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Brian August Nguyen <brianacnguyen@gmail.com>
@pull pull Bot locked and limited conversation to collaborators May 7, 2026
@pull pull Bot added the ⤵️ pull label May 7, 2026
@pull pull Bot merged commit 8136f4f into Reality2byte:main May 7, 2026
28 of 48 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants